package com.example.secondhandsysapi.Service;

import com.example.secondhandsysapi.Entity.Category;
import com.example.secondhandsysapi.Mapper.CategoryMapper;
import com.example.secondhandsysapi.Vo.CGC;
import com.example.secondhandsysapi.Vo.CategoryGoodsInfo;
import com.example.secondhandsysapi.Vo.IpMoney;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CategoryServiceImpl implements CategoryService{

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> getAllCategoryInfo() {
        return categoryMapper.getAllCategoryInfo();
    }

    @Override
    public List<Category> getAllCategory(String name) {
        return categoryMapper.getAllCategory(name);
    }

    @Override
    public Integer insertCategory(Category category) {
        return categoryMapper.insertCategory(category);
    }

    @Override
    public Integer delById(Integer id) {
        return categoryMapper.delById(id);
    }

    @Override
    public Integer updateCategory(Category category) {
        return categoryMapper.updateCategory(category);
    }

    @Override
    public List<CategoryGoodsInfo> getAllCategoryGoods(Integer id) {
        return categoryMapper.getAllCategoryGoods(id);
    }

    //获取ip的金额和销售金额
    @Override
    public List<Map<String, Object>> getIpMoney() {
        return categoryMapper.getIpMoney();
    }

    @Override
    public List<CGC> getCategoryGoods() {
        return categoryMapper.getCategoryGoods();
    }

    @Override
    public List<Category> getCategoryList(Integer category_id) {
        return categoryMapper.getCategoryList(category_id);
    }
}
